Optimal. Leaf size=114 \[ -\frac {i d \text {Li}_2\left (e^{2 i (a+b x)}\right )}{2 b^2}-\frac {d \sin (a+b x) \cos (a+b x)}{4 b^2}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {(c+d x) \sin ^2(a+b x)}{2 b}+\frac {d x}{4 b}-\frac {i (c+d x)^2}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 114, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 8, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {4408, 4404, 2635, 8, 3717, 2190, 2279, 2391} \[ -\frac {i d \text {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{2 b^2}-\frac {d \sin (a+b x) \cos (a+b x)}{4 b^2}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {(c+d x) \sin ^2(a+b x)}{2 b}+\frac {d x}{4 b}-\frac {i (c+d x)^2}{2 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 2190
Rule 2279
Rule 2391
Rule 2635
Rule 3717
Rule 4404
Rule 4408
Rubi steps
\begin {align*} \int (c+d x) \cos ^2(a+b x) \cot (a+b x) \, dx &=\int (c+d x) \cot (a+b x) \, dx-\int (c+d x) \cos (a+b x) \sin (a+b x) \, dx\\ &=-\frac {i (c+d x)^2}{2 d}-\frac {(c+d x) \sin ^2(a+b x)}{2 b}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)}{1-e^{2 i (a+b x)}} \, dx+\frac {d \int \sin ^2(a+b x) \, dx}{2 b}\\ &=-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {d \cos (a+b x) \sin (a+b x)}{4 b^2}-\frac {(c+d x) \sin ^2(a+b x)}{2 b}+\frac {d \int 1 \, dx}{4 b}-\frac {d \int \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b}\\ &=\frac {d x}{4 b}-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {d \cos (a+b x) \sin (a+b x)}{4 b^2}-\frac {(c+d x) \sin ^2(a+b x)}{2 b}+\frac {(i d) \operatorname {Subst}\left (\int \frac {\log (1-x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^2}\\ &=\frac {d x}{4 b}-\frac {i (c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d \text {Li}_2\left (e^{2 i (a+b x)}\right )}{2 b^2}-\frac {d \cos (a+b x) \sin (a+b x)}{4 b^2}-\frac {(c+d x) \sin ^2(a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.35, size = 131, normalized size = 1.15 \[ \frac {d \left ((a+b x) \log \left (1-e^{2 i (a+b x)}\right )-\frac {1}{2} i \left ((a+b x)^2+\text {Li}_2\left (e^{2 i (a+b x)}\right )\right )\right )}{b^2}-\frac {d \sin (2 (a+b x))}{8 b^2}-\frac {a d \log (\sin (a+b x))}{b^2}-\frac {c \sin ^2(a+b x)}{2 b}+\frac {c \log (\sin (a+b x))}{b}+\frac {d x \cos (2 (a+b x))}{4 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.59, size = 292, normalized size = 2.56 \[ -\frac {b d x - 2 \, {\left (b d x + b c\right )} \cos \left (b x + a\right )^{2} + d \cos \left (b x + a\right ) \sin \left (b x + a\right ) + 2 i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 2 i \, d {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) + 2 i \, d {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) - 2 \, {\left (b c - a d\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) - 2 \, {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left (b d x + a d\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right )}{4 \, b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (d x + c\right )} \cos \left (b x + a\right )^{2} \cot \left (b x + a\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.41, size = 249, normalized size = 2.18 \[ i c x -\frac {i d \,x^{2}}{2}+\frac {c \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b}+\frac {c \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b}-\frac {2 c \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}-\frac {i d \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {i d \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {i d \,a^{2}}{b^{2}}+\frac {d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b}-\frac {2 i d a x}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}-\frac {d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{2}}+\frac {2 d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {\left (d x +c \right ) \cos \left (2 b x +2 a \right )}{4 b}-\frac {d \sin \left (2 b x +2 a \right )}{8 b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.79, size = 222, normalized size = 1.95 \[ \frac {-4 i \, b^{2} d x^{2} - 8 i \, b^{2} c x - 8 i \, b d x \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) + 8 i \, b c \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) - 1\right ) + {\left (8 i \, b d x + 8 i \, b c\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) + 2 \, {\left (b d x + b c\right )} \cos \left (2 \, b x + 2 \, a\right ) - 8 i \, d {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) - 8 i \, d {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + 4 \, {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + 4 \, {\left (b d x + b c\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) - d \sin \left (2 \, b x + 2 \, a\right )}{8 \, b^{2}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\cos \left (a+b\,x\right )}^2\,\mathrm {cot}\left (a+b\,x\right )\,\left (c+d\,x\right ) \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (c + d x\right ) \cos ^{2}{\left (a + b x \right )} \cot {\left (a + b x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________